# -*- coding: utf-8 -*-
import requests
import time

start_time = time.time()
# 记录开始运行时间
url = "http://127.0.0.1:5000/predict"
data = {"text": "天下万般兵刃，唯有过往伤人最深"}
try:
    response = requests.post(url , json=data)
    elapsed_time = (time.time() - start_time)*1000
    print(elapsed_time)
    #检查响应状态
    if response.status_code == 200:
        result = response.json()
        print(f"预测结果:{result}")
except Exception as e:
    print(f"请求出错:{str(e)}")

